<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>CORS跨域测试</title>

    <script>
        const url1 = 'https://mock.yonyoucloud.com/mock/17496/yimu/companyInfo';
        const url2 = 'https://api.bilibili.com/x/relation/stat?vmid=52374669';

        const xmlhttp = new XMLHttpRequest();
        xmlhttp.open("GET", url2, true);
        xmlhttp.send();
        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
            console.log(xmlhttp.responseText);
        };
    </script>
  </head>

  <body></body>
</html>
